﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;

namespace RiskMan.DataClass.BaseTransaqCalss
{
    public class Securities : INotifyPropertyChanged
    {
        private int _secid;
        private bool _active;
        private string _seccode;
        private string _board;
        private int _market;
        private string _shortname;
        private int _decimals;
        private double _minstep;
        private int _lotsize;
        private double _point_cost;
        private string _usecredit;
        private string _buyMarket;
        private string _nosplit;
        private string _immocancel;
        private string _cancelBalance;
        private string _secType;

        #region Public
        /// <summary>
        /// внутренний код
        /// </summary>
        public int Secid
        {
            get { return _secid; }
            set
            {
                if (_secid != value)
                {
                    _secid = value;
                    RaisePropertyChanged("Secid");
                }
            }
        }

        /// <summary>
        /// true/false
        /// </summary>
        public bool Active
        {
            get { return _active; }
            set
            {
                if (_active != value)
                {
                    _active = value;
                    RaisePropertyChanged("Active");
                }
            }
        }

        /// <summary>
        /// код инструмента
        /// </summary>
        public string Seccode
        {
            get { return _seccode; }
            set
            {
                if (_seccode != value)
                {
                    _seccode = value;
                    RaisePropertyChanged("Seccode");
                }
            }
        }

        /// <summary>
        /// Идентификатор режим торгов по умолчанию
        /// </summary>
        public string Board
        {
            get { return _board; }
            set
            {
                if (_board != value)
                {
                    _board = value;
                    RaisePropertyChanged("Board");
                }
            }
        }

        /// <summary>
        /// Идентификатор бумаги
        /// </summary>
        public int Market
        {
            get { return _market; }
            set
            {
                if (_market != value)
                {
                    _market = value;
                    RaisePropertyChanged("Market");
                }
            }
        }

        /// <summary>
        /// Наименование бумаги
        /// </summary>
        public string Shortname
        {
            get { return _shortname; }
            set
            {
                if (_shortname != value)
                {
                    _shortname = value;
                    RaisePropertyChanged("Shortname");
                }
            }
        }

        /// <summary>
        /// Количество десятичных знаков в цене
        /// </summary>
        public int Decimals
        {
            get { return _decimals; }
            set
            {
                if (_decimals != value)
                {
                    _decimals = value;
                    RaisePropertyChanged("Decimals");
                }
            }
        }

        /// <summary>
        /// Шаг цены
        /// </summary>
        public double Minstep
        {
            get { return _minstep; }
            set
            {
                if (_minstep != value)
                {
                    _minstep = value;
                    RaisePropertyChanged("Minstep");
                }
            }
        }

        /// <summary>
        /// Размер лота
        /// </summary>
        public int Lotsize
        {
            get { return _lotsize; }
            set
            {
                if (_lotsize != value)
                {
                    _lotsize = value;
                    RaisePropertyChanged("Lotsize");
                }
            }
        }

        /// <summary>
        /// Стоимость пункта цены
        /// </summary>
        public double Point_cost
        {
            get { return _point_cost; }
            set
            {
                if (_point_cost != value)
                {
                    _point_cost = value;
                    RaisePropertyChanged("Point_cost");
                }
            }
        }

        /// <summary>
        /// yes/no
        /// </summary>
        public string Usecredit
        {
            get { return _usecredit; }
            set
            {
                if (_usecredit != value)
                {
                    _usecredit = value;
                    RaisePropertyChanged("Usecredit");
                }
            }
        }

        /// <summary>
        /// yes/no
        /// </summary>
        public string BuyMarket
        {
            get { return _buyMarket; }
            set
            {
                if (_buyMarket != value)
                {
                    _buyMarket = value;
                    RaisePropertyChanged("BuyMarket");
                }
            }
        }

        /// <summary>
        /// yes/no
        /// </summary>
        public string Nosplit
        {
            get { return _nosplit; }
            set
            {
                if (_nosplit != value)
                {
                    _nosplit = value;
                    RaisePropertyChanged("Nosplit");
                }
            }
        }

        /// <summary>
        /// yes/no
        /// </summary>
        public string Immocancel
        {
            get { return _immocancel; }
            set
            {
                if (_immocancel != value)
                {
                    _immocancel = value;
                    RaisePropertyChanged("Immocancel");
                }
            }
        }

        /// <summary>
        /// yes/no
        /// </summary>
        public string CancelBalance
        {
            get { return _cancelBalance; }
            set
            {
                if (_cancelBalance != value)
                {
                    _cancelBalance = value;
                    RaisePropertyChanged("CancelBalance");
                }
            }
        }

        /// <summary>
        /// Тип бумаги
        /// </summary>
        public string SecType
        {
            get { return _secType; }
            set
            {
                if (_secType != value)
                {
                    _secType = value;
                    RaisePropertyChanged("SecType");
                }
            }
        }
        #endregion


        #region event PropertyChangedEventHandler

        public event PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName)
        {
            var handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion
    }
}
